#!/usr/bin/env python
# _*_ coding: utf-8 _*_
# @Time : 2022/8/8 12:11
# @Author : Violet
# @File : bar.py
# @desc :饼图
from random import randrange
from pyecharts import options as opts

from pyecharts.charts import Bar


async def bar_base() -> Bar:
    c = (
        Bar()
            .add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
            .add_yaxis("商家A", [randrange(0, 100) for _ in range(6)])
            .add_yaxis("商家B", [randrange(0, 100) for _ in range(6)])
            .set_global_opts(title_opts=opts.TitleOpts(title="Bar-基本示例", subtitle="我是副标题"))
    )
    return c
